function createActivity() {
    var opts = new Array();

    opts[opensocial.Activity.Field.TITLE] = 'Gadget activity title';
    opts[opensocial.Activity.Field.BODY] = 'Play and Win created activity';
   

    var activity = opensocial.newActivity(opts);

    // Request the activity creation
    opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH,activitiyCallback);
}
/**
 * Callback method to handle the createActivity method.
 */
function activitiyCallback(status) {
  if (status.hadError())
  {
	alert(status.getErrorMessage());

     alert("operation failed.");
  }
  else 
  {
    alert("operation success.");
  }
};